package system.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import common.controller.base.BaseController;
import common.model.po.SysLog;
import common.model.request.base.PaginationRequest;
import common.model.response.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import system.model.request.SearchSystemLogRequest;
import system.service.SysLogService;

import javax.annotation.Resource;

/**
 * 系统日志管理
 *
 * @author 米泽鹏
 * @since 2022-03-16
 */
@Api(tags = "系统日志管理")
@RestController
@RequestMapping("/system/sys-log")
public class SysLogController extends BaseController {

	@Resource
	private SysLogService logService;

	@ApiOperation(value = "系统日志分页查询", notes = "系统日志分页查询")
	@PostMapping("/readOnly/pageSystemLog")
	public Result<Page<SysLog>> pageSystemLog(@ApiParam(value = "分页查询请求", required = true) @RequestBody @Validated PaginationRequest<SearchSystemLogRequest, SysLog> paginationRequest) {
		return successWithData(logService.pageSystemLog(paginationRequest));
	}

}
